package com.kxc.dao;

import java.util.Date;

import javax.transaction.Transactional;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import com.kxc.entity.SurfaceDisplacementWarn;

/**表面位移预警阈值设置
 */
public interface SurfaceDisplacementWarnDao extends JpaRepository<SurfaceDisplacementWarn,Long>,JpaSpecificationExecutor<SurfaceDisplacementWarn> {
      
	public Page<SurfaceDisplacementWarn> findAll(Specification<SurfaceDisplacementWarn> specification, Pageable pageable);

	public SurfaceDisplacementWarn findByPointNum(String pointNum);
	@Transactional
	public int deleteByPointNum(String pointNum);
	@Transactional
	@Modifying
	@Query("update surfacedisplacementwarn m set m.sBW=?2,m.lBW=?3,m.sYW=?4,m.lYW=?5,m.sOW=?6,m.lOW=?7,m.sRW=?8,m.lRW=?9,m.modifyTime=?10 where  m.pointNum=?1")
	public int  updateSurfaceDisplacementWarn(String pointNum, String sbw, String lbw, String syw, String lyw, String sow,
			String low, String srw, String lrw,Date modifyTime);
}
